﻿using NLog;


namespace Project.Yan.Net.Tool.Log
{
    public class LoggerService: ILoggerService
    {
        private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        public void LogInformation(string message)
        {
            Logger.Info(message);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        public void LogWarning(string message)
        {
            Logger.Warn(message);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        public void LogError(string message,Exception ex= null)
        {
            Logger.Error(ex ?? new Exception("No specific exception provided."), message);
        }
    }
}
